<!--公司账户-->
<template>
	<div class="feedback">

		<div class="my_header">
			<i class="mui-icon mui-icon-arrowleft" aria-hidden="true" @click="$router.back(-1)"></i>
			<div class="top1">意见反馈</div>

		</div>
		<div class="txlist">
			<!-- <div class="row dashborder">
				<div class="left"><span>*</span>您的姓名</div>
				<div class="right"><input  v-model="paramsList.name" type="text" placeholder="请输入姓名"></div>
			</div>
			<div class="row dashborder">
				<div class="left"><span>*</span>联系电话</div>
				<div class="right"><input v-model="paramsList.mobile" type="text" placeholder="请输入联系电话"></div>
			</div>
			<div class="row dashborder" @click="openfeed">
				<div class="left"><span>*</span>反馈类型</div>
				<div class="right">
            <input v-model="feedbackname" type="text" readonly placeholder="请选择">
				</div>	
			</div>
			<van-popup v-model="show"  position="bottom" :overlay="false" >
					<van-picker
						show-toolbar
						:columns="columns"
						@cancel="onCancel"
						@confirm="onConfirm"
            @change="onChange" 
						/>

				</van-popup> -->
			<div class="rowcell dashborder">
				<div class="left"><span>*</span>描述内容</div>
				<div class="right"><textarea v-model="paramsList.content" placeholder="请描述您要反馈的意见" rows="4"></textarea></div>
			</div>
			
				<!-- 提交 -->
			<div class="button">
				<button class="btn" @click="subBtn()">提 交</button>
			</div>
		</div>
	</div>
</template>

<script>
export default {
  data() {
    return {
      // feedbackname:'',
      // show: false,
      // typeList: [],
      message: "",
      paramsList: {
        token: "",
        // name: "",
        // mobile: "",
        content: "",
        // feedback_type_id: ""
      },
      // columns: [],
      // areaList: {
      //   province_list: {}
      // }
    };
  },
  created() {
  	var token = localStorage.getItem("token");
  	this.paramsList.token=token;
    // 获取反馈类型
    // $.ajax({
    //   type: "get",
    //   url: "http://zcapi.hrgsxt.cn/api/Welcome/feedback_type",
    //   dataType: "json",
    //   success: res => {
    //     // console.log(res)
    //     // 反馈成功
    //     if (res.code === 200) {
    //        this.typeList = res.data;
    //       console.log(res);
    //       for (var i = 0; i < res.data.length; i++) {
    //         this.columns.push(res.data[i].name);
    //       }
    //     }
    //   }
    // });
  },
  methods: {
    // onChange(picker, value, index) {
    //   var feekid=`${index}`;
    //   this.paramsList.feedback_type_id=this.typeList[feekid].feedback_type_id;
    // },
    //   反馈类型
    // openfeed() {
    //   this.show = true;
    // },
    // onCancel() {
    //   this.show = false;
    // },
    // onConfirm(value, index) {
    //    this.feedbackname=`${value}`;
    //   this.show = false;
    // },

    // 意见反馈提交按钮注册点击事件
    subBtn() {
      // 提交之前判断输入时候合法
      // if (this.paramsList.name == "") {
      //   this.tos = true;
      //   this.$toast("请输入姓名");
      // } else if (this.paramsList.mobile == "") {
      //   this.$toast("请输入联系方式");
      // } else if (this.paramsList.feedback_type_id == "") {
      //   this.$toast("请选择反馈类型");
      // } else 
      if (this.paramsList.content == "") {
        this.$toast("请输入描述内容");
      } else {
        // 数据校验成功，提交
        $.ajax({
          type: "post",
          url: "http://zcapi.hrgsxt.cn/api/User_message/feedback",
          dataType: "json",
          data: this.paramsList,
          success: res => {
            // 反馈成功
            if (res.code === 200) {      
              this.$toast("提交成功");
              setTimeout(function(){
               history.go(-1)
              },1000)
            }
          }
        });
      }
    }
  }
};
</script>

<style scoped>
.feedback{
  width: 100%;
}
.rowcell .right textarea {
  padding-top: 1.5px ;
  margin: 0px !important;
  border: none;
}
.row .right input {
  border: none;
  outline: none;
  line-height: 0.88rem;
  text-align: right;
  padding: 0px !important;
  margin-bottom: 4px !important;
  width: 90%;
}
.row .right .typetaocan {
  width: 40%;
}
.error {
  color: #fc355d;
}

/*查询记录*/

.margintop10 {
  margin-top: 10px;
}

.txlist .row.dashborder {
  border-bottom: 0.05rem dashed #efefef;
}

.submit {
  background-color: #0085f0;
  font-size: 0.34rem;
  color: #ffffff;
  width: 90%;
  margin-left: 5%;
  margin-top: 5%;
  height: 0.88rem;
  line-height: 0.88rem;
  border-radius: 12px;
}

.my_header .top1 {
  margin-right: 20px;
}

.my_header {
  height: 0.88rem;
  background: rgba(0, 133, 240, 1);
  text-align: center;
  color: #fff;
  line-height: 0.88rem;
  position: relative;
  padding: 0 0.3rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 999;
}

.my_header i {
  font-size: 0.4rem;
  float: left;
  line-height: 0.88rem;
}

.myaccount .my_header .top1 {
  width: 40%;
  margin-left: 25%;
  float: left;
  text-align: center;
}

.myaccount .my_header .cmaccount {
  float: right;
  font-size: 0.28rem;
}

.txlist {
  margin-top: 0.88rem;
}

.txlist .row {
  width: 100%;
  height: 0.88rem;
  background-color: #ffffff;
  line-height: 0.88rem;
  padding: 0px 0.35rem 0px 0.5rem;
  border-bottom: 0.01rem dashed #efefef;
}

.txlist .row:last-child {
  border-bottom: none;
}

.txlist .row .left {
  width: 24%;
  float: left;
  font-size: 0.3rem;
}

.txlist .row .left span {
  color: red;
  margin-right: 5px;
  margin-left: -9px;
}

.txlist .row .right {
  color: #666666;
  width: 76%;
  float: right;
  font-size: 0.26rem;
  line-height: 0.88rem;
  text-align: right;
  height: 0.88rem;
}

.txlist .rowcell {
  border-bottom: 1px solid #efefef;
  background-color: #ffffff;
  overflow: auto;
  padding: 0.26rem 0.35rem 0.26rem 0.5rem;
}

.txlist .rowcell .left {
  width: 25%;
  float: left;
  font-size: 0.3rem;
}

.txlist .rowcell .right {
  padding-left: 0.3rem;
  color: #666666;
  width: 73%;
  float: right;
  font-size: 0.26rem;
  line-height: 0.4rem;
  text-align: left;
}
.rowcell span {
  color: red;
  margin-right: 5px;
  margin-left: -9px;
}
.txlist .rowcell .right img {
  width: 1.7rem;
}

/* 提交按钮 */
.button {
  text-align: center;
  background-color: #fff;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  color: #ffffff
}

.btn {
  width: 93.33%;
  height: 0.88rem;
  background: rgba(0, 133, 240, 1);
  border-radius: 0.15rem;
}
</style>